﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FileTransferProtocol;
namespace FileTransferClient
{
    public class BlockFinishedEventArgs : EventArgs
    {
        public FileBlock Block { get; set; }
        public BlockFinishedEventArgs(FileBlock Block) { this.Block = Block; }
    }
    public class AllFinishedEventArgs : EventArgs
    {
        public string FileName { get; set; }
        public AllFinishedEventArgs(string fileName) { this.FileName = fileName; }
    }
    public class FileTransmissionErrorOccurEventArgs : EventArgs
    {
        public Exception InnerException { get; set; }
        /// <summary>
        /// 指示是否继续运行
        /// </summary>
        public bool Continue { get; set; }
        public FileTransmissionErrorOccurEventArgs(Exception innerException)
        {
            InnerException = innerException;
            Continue = false;
        }
    }
    public delegate void BlockFinishedEventHandler(object sender, BlockFinishedEventArgs e);
    public delegate void FileTransmissionErrorOccurEventHandler(object sender, FileTransmissionErrorOccurEventArgs e);
    public delegate void AllFinishedEventHandler(object sender, AllFinishedEventArgs e);
    public delegate void TransferEventHandler(object sender, EventArgs e);
}
